﻿#pragma once

#include <occmesh/api/half.h>

struct Coons
{
    TopoDS_Face Covering(Wire *wire);

  private:
    bool PrepareBoundaryCurves(Wire *wire);
    void PrepareDerivateFields(Wire *wire);
    void InterpInteriorPoint(const gp_Pnt &p1, const gp_Pnt &p2, const gp_Vec &v1, const gp_Vec &v2, gp_Pnt *poles);
    void AccumulatePoint(Handle(Geom_BSplineCurve) cur, const gp_Pnt &p1, const gp_Pnt &p2, const gp_Vec &v1,
                         const gp_Vec &v2, int k, char rc);
    Handle(Geom_BSplineSurface) BuildBilinearSurface();

    Handle(Geom_BSplineCurve) boundaryCurves[4];
    Handle(Geom_BSplineCurve) derivateFields[4];
    TColgp_Array2OfPnt dstPoly;
};
